function ratingCtrl($scope, $stateParams,$http,$location) {
	
	$scope.periods = [{id:1, name:"Not Good"}, {id:2,name:"Below Average"},{id:3 ,name:"Average"},{id:4,name:"Good"},{id:5 ,name:"Excellent"}];
	$scope.review = "";

	$scope.selectedPeriod = $scope.periods[3];
	
	$scope.submitRating=function(){
		var description = $scope.review;

		var ratingVal = 0;
		
		
		if($scope.selectedPeriod.id==undefined) {
			ratingVal = $scope.selectedPeriod[0];
		} else {
			ratingVal = $scope.selectedPeriod.id;
		}
		
		console.log($scope.rating);
	//	alert('Desc is '+description+' and rating is '+ratingVal);

	
		$http({
			url: 'counsel/'+$stateParams.id+'/rating', 
    		method: "GET",
    		params: {rating: ratingVal , review: description}
 		});
 		$location.url('/dashboard/feed');
		}
}

ratingCtrl.$inject = ['$scope', '$stateParams','$http','$location'];//inject required